home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 001-025 / disk_024 / conquest / conq3.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  3KB  |  101 lines

  1. #include "defs.h"
  2. #include "structs.h"
  3. #include "vars.h"
  4. #include <stdio.h>
  5.  
  6.  
  7. new_research()
  8. {
  9.         if ( weapons[player] - weapons[ENEMY] > 1 )
  10.                 en_research = 'W';
  11.         else {
  12.                 switch ( rnd(10) ){
  13.  
  14.                 case 1: 
  15.                 case 2: 
  16.                 case 3: 
  17.                         en_research = 'V';
  18.                         break;
  19.                 default:
  20.                         en_research = 'W';
  21.                         break;
  22.                 case 10: 
  23.                         en_research = 'R';
  24.  
  25.                 }; /*switch (*/
  26.         };
  27. }
  28.  
  29.  
  30. pl2yerattack(starnum)
  31. int starnum;
  32. {
  33.         boolean battle;
  34.         char command;
  35.         struct stplanet *pplanet;
  36.         battle = any_bc(player,starnum);
  37.         if ( (battle) ) {
  38.                 point(33,20);
  39.                 printf("Attack at star %c", starnum+'A'-1);
  40.                 while (battle ) {
  41.                         point(50,1);
  42.                         pr5nt_star(starnum);
  43.                         clear_field();
  44.                         point(1,18);
  45.                         printf("P?                            ");
  46.                         point(3,18);
  47.                         get_char(&command);
  48.                         switch ( command ) {
  49.                         case 'S':
  50.                                 starsum();
  51.                                 break;
  52.                         case 'M' : 
  53.                                 printmap();
  54.                                 break;
  55.                         case 'H': 
  56.                                 help(3);
  57.                                 pause();
  58.                                 break;
  59.                         case 'N': 
  60.                                 make_tf();
  61.                                 break;
  62.                         case 'J': 
  63.                                 join_tf();
  64.                                 break;
  65.                         case 'C': 
  66.                                 print_col();
  67.                                 break;
  68.                         case 'R': 
  69.                                 ressum();
  70.                                 break;
  71.                         case 'T': 
  72.                                 tfsum();
  73.                                 break;
  74.                         case 'G': 
  75.                         case ' ': 
  76.                                 play_salvo(starnum,&battle);
  77.                                 break;
  78.                         case 'B': 
  79.                                 printf("reak off attack");
  80.                                 battle = false;
  81.                                 break;
  82.                         default:
  83.                                 cle3r_left();
  84.                                 error_message();
  85.                                 printf(" !Illegal command");
  86.                                 break;
  87.                         }; /*switch (*/
  88.                 };
  89.                 pplanet = stars[starnum].first_planet;
  90.                 while (pplanet != nil ) {
  91.                         pplanet->under_attack = false;
  92.                         pplanet = pplanet->next;
  93.                 };
  94.                 point(1,24);
  95.                 printf("Planet attack concluded       ");
  96.                 revolt(starnum);
  97.         };
  98.  
  99. }
  100.  
  101.